/*
 * Criado em Mar 21, 2005
 *
 *
 */
package vendas.dto;

import gminet.infra.dao.SimpleTransferObject;

import java.util.List;

/**
 * @author Gabriel Flores Mendes
 * 
 * 
 */
public class ActionType extends SimpleTransferObject {

    private static final long serialVersionUID = 6492170805419893930L;

    // ACTIONS
    private static final byte UNDEFINED_ID = 0;
    private static final byte INSERT_ID = 11;
    private static final byte EDIT_ID = 12;
    private static final byte DELETE_ID = 19;
    private static final byte ACTIVE_ID = 31;
    private static final byte DESACTIVE_ID = 32;
    // ACTIONS ITEM
    private static final byte ARRIVE_ITEM_ID = 51;
    private static final byte SELL_ITEM_ID = 52;
    private static final byte RECEIVE_PAYMENT_ID = 53;
    private static final byte PAY_ITEM_ID = 55;

    public static final ActionType UNDEFINED = new ActionType(UNDEFINED_ID, "INDEFINIDO");
    public static final ActionType INSERT = new ActionType(INSERT_ID, "INSERT");
    public static final ActionType EDIT = new ActionType(EDIT_ID, "EDIT");
    public static final ActionType DELETE = new ActionType(DELETE_ID, "DELETE");
    public static final ActionType ACTIVE = new ActionType(ACTIVE_ID, "ACTIVE");
    public static final ActionType DESACTIVE = new ActionType(DESACTIVE_ID, "DESACTIVE");
    public static final ActionType ARRIVE_ITEM = new ActionType(ARRIVE_ITEM_ID, "ARRIVE ITEM");
    public static final ActionType SELL_ITEM = new ActionType(SELL_ITEM_ID, "SELL ITEM");
    public static final ActionType RECEIVE_PAYMENT = new ActionType(RECEIVE_PAYMENT_ID, "RECEIVE PAYMENT ITEM");
    public static final ActionType PAY_ITEM = new ActionType(PAY_ITEM_ID, "PAY ITEM");

    static {
        Class<ActionType> clazz = ActionType.class;
        addObject(clazz, INSERT);
        addObject(clazz, EDIT);
        addObject(clazz, DELETE);
        addObject(clazz, ACTIVE);
        addObject(clazz, DESACTIVE);
        addObject(clazz, ARRIVE_ITEM);
        addObject(clazz, SELL_ITEM);
        addObject(clazz, RECEIVE_PAYMENT);
        addObject(clazz, PAY_ITEM);
    }

    private ActionType(int i, String str) {

        super(i, str);
    }

    @SuppressWarnings("unchecked")
    public static List<ActionType> getList() {

        return (List<ActionType>) getList(ActionType.class);
    }

    public static ActionType getActionTypeById(int typeId) {

        return (ActionType) getObject(ActionType.class, typeId);
    }

}
